<?php
/**
* @author: Truong Kim Phung
* @date: Friday, January 24, 2014
*/

/**
* Not login
* Not permission
*
* Note: only root, administrator, leader with permission admin module
*/
if( !isset($AppUI) || 
	(isset($AppUI->id) && !in_array($AppUI->type, $arrChkPerm)) ||
    !isset($_SESSION['admin'])
) {
	redirect(HOST_BACKEND);
}
$this->load->model('admin_model', 'admin');	
$intTotal   = 0;
$intPage    = $this->input->get('page', 1);
$intLimit   = 20;
$intOffset  = ($intPage-1)*$intLimit;
$arrResult	= $this->admin->getAll($AppUI->type,$intOffset, $intLimit, $intTotal);
$this->smarty->assign('arrResult',  $arrResult);
$this->smarty->assign('intTotal',   $intTotal);
$this->smarty->assign('intOffset',  $intOffset);
$this->smarty->assign('intLimit',   $intLimit);
$this->smarty->assign('arrStatus',  $arrStatus);
$this->smarty->assign('arrType',    $arrType);
$this->smarty->display('admin/index.tpl');